import logging
from traceback import print_tb

import pytz

#基本配置
logging.basicConfig(
    level=logging.DEBUG,
    format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    # filename="demo.log",
    filemode="a"
)

#使用日志
logging.debug("调试信息")
logging.info("程序正常运行")
logging.warning("警告信息")
logging.error("错误信息")
logging.critical("严重错误")

########
import keyword
import random
print(keyword.kwlist)
print(int(random.random() * 10))

print("#" * 20)
#打印九九乘法表
row = 1
while row <= 9:
    col = 1
    while col <= row:
        print(f'{col} * {row} = {row * col}', end='\t')
        col += 1
    print("")
    row += 1

print("#" * 20)
print("#" * 20)
from datetime import datetime
print(datetime.now())
print(datetime.now(tz=pytz.timezone('utc')))
# print(datetime.utcnow())

string = "ddvnggijer24r534nkl34h3lhtl3"
print(string[5:10:2])

students = [
    {"name": "阿土",
     "age": 20,
     "gender": True,
     "height": 1.7,
     "weight": 75.0},
    {"name": "小美",
     "age": 19,
     "gender": False,
     "height": 1.6,
     "weight": 45.0},
]

find_name = "阿土"

for student in students:
    print(student)
    if student["name"] == find_name:
        print("找到了")
        break
else:
    print("没有找到")

